<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Video Stream Module for PHP-Nuke with many features                  */
/*                                                                      */
/* Copyright (c) 2006 by Scott Cariss (Brady)                           */
/* http://www.steezmatic-designs.com                                    */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
	die ("You can't access this file directly...");
}

if(($sendV == 1) && ($looker == "Anonymous")) {
	echo ""._REGSEND."";
} else {
	
	if($_POST['Send']) {
	
		global $nukeurl;
		$checking = substr($nukeurl, -1); 
		if ($checking != "/") { $nukeurl = "".$nukeurl."/"; }
		
		$yname = $_POST['yname']; $yemail = $_POST['yemail']; $fname = $_POST['fname']; $femail = $_POST['femail'];
			
		$to = "".$fname." <".$femail.">";
		$from = "".$yname." <".$yemail.">";
		$title = ""._YOURFRIEND." "._HASRECOMMEND."";
		$headers  = "From:".$from."\r\n";
		$headers .= "Reply-To:".$from."\r\n";
		$headers .= "To:".$to."\r\n";
		
		$body = ""._YOURFRIEND." (".$yname.") "._HASRECOMMEND.":\n\n".$nukeurl."modules.php?name=Video_Stream&page=watch&id=".$id."\n\n----------------------------------------------------------\nThis is email was generated by HTTP Video Streaming Module";
		
		userpointsVS(3);
		$success = mail($to, $title, $body, $headers);
		
		if($success) {
			echo ""._EMAILSENT." ".$fname." (".$femail.")";
		} else {
			echo ""._EMAILNOTSENT."";
		}
	
	} else {
		echo "<form name=\"form1\" method=\"post\" action=\"\"><table width=\"100%\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
		echo "<td><div align=\"center\">"._YNAME."</div></td></tr><tr><td><div align=\"center\"><input name=\"yname\" type=\"text\" id=\"yname\"></div></td>";
		echo "</tr><tr><td><div align=\"center\">"._YEMAIL."</div></td></tr><tr><td><div align=\"center\"><input name=\"yemail\" type=\"text\" id=\"yemail\">";
		echo "</div></td></tr><tr><td><div align=\"center\">"._FNAME."</div></td></tr><tr><td><div align=\"center\"><input name=\"fname\" type=\"text\" id=\"fname\">";
		echo "</div></td></tr><tr><td><div align=\"center\">"._FEMAIL."</div></td></tr><tr><td><div align=\"center\"><input name=\"femail\" type=\"text\" id=\"femail\">";
		echo "</div></td></tr><tr><td><div align=\"center\"></div></td></tr><tr><td><div align=\"center\"><input type=\"submit\" name=\"Send\" value=\""._SEND."\">";
		echo "</div></td></tr></table></form>";
	}
}
?>